import request from '@/utils/request'

// 查询发布天猫任务列表
export function listTask(query) {
  return request({
    url: '/jihuo/task/list',
    method: 'get',
    params: query
  })
}

// 查询发布天猫任务详细
export function getTask(jhId) {
  return request({
    url: '/jihuo/task/' + jhId,
    method: 'get'
  })
}

// 新增发布天猫任务
export function addTask(data) {
  return request({
    url: '/jihuo/task',
    method: 'post',
    data: data
  })
}

// 修改发布天猫任务
export function updateTask(data) {
  return request({
    url: '/jihuo/task',
    method: 'put',
    data: data
  })
}

// 删除发布天猫任务
export function delTask(jhId) {
  return request({
    url: '/jihuo/task/' + jhId,
    method: 'delete'
  })
}

export function startTask(jhId) {
  return request({
    url: '/jihuo/task/start/' + jhId,
    method: 'post'
  })
}
export function againStartTask(jhId) {
  return request({
    url: '/jihuo/task/againStart/' + jhId,
    method: 'post'
  })
}
export function cancelTask(jhId) {
  return request({
    url: '/jihuo/task/cancel/' + jhId,
    method: 'post'
  })
}
